package com.love.poetry.application.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.love.poetry.application.CategoryService;
import com.love.poetry.domain.Category;
import com.love.poetry.infrastructure.persist.CategoryRepository;
import com.youboy.core.orm.Page;

@Transactional
@Service
public class CategoryServiceImpl implements CategoryService{
	
	@Autowired
	private CategoryRepository categoryRepository;
	
	public Category queryUniqueByPath(String path) {
		return categoryRepository.queryUniqueByPath(path);
	}

	public Category queryUniqueByName(String name) {
		return categoryRepository.queryUniqueByName(name);
	}

	public Page<Category> queryPage(Page<Category> page) {
		return categoryRepository.queryPage(page);
	}

	public Category get(String id) {
		return categoryRepository.get(id);
	}

	public void save(Category category) {
		categoryRepository.save(category);
	}

	public void update(Category category) {
		categoryRepository.update(category);		
	}

	public void delete(String id) {
		categoryRepository.delete(id);		
	}

	public List<Category> queryTop() {
		return categoryRepository.queryTop();
	}

	public Page<Category> queryPageTop(Page<Category> page) {
		return categoryRepository.queryPageTop(page);
	}

	public List<Category> query(Object object) {
		return categoryRepository.query(object);
	}

	public List<Category> queryChildById(String id) {
		return categoryRepository.queryChildById(id);
	}

	public Page<Category> queryPageChildById(Page<Category> page, String id) {
		return categoryRepository.queryPageChildById(page, id);
	}

	public List<Category> queryCategories() {
		return categoryRepository.queryCategories();
	}

}
